# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Aaron Schaefer <aaron@elasticdog.com>

pkgname=optipng
pkgver=0.7.7
pkgrel=2
pkgdesc='Compresses PNG files to a smaller size, without losing any information.'
arch=('loong64' 'x86_64')
url='http://optipng.sourceforge.net/'
license=('ZLIB')
depends=('glibc' 'libpng' 'zlib')
source=("https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz")
md5sums=('211101965baf42fd24a2aa990b7e842e')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure --prefix=/usr --mandir=/usr/share/man --with-system-libs
  make
}
package() {
  cd "$srcdir/$pkgname-$pkgver"

  make prefix="$pkgdir/usr" mandir="$pkgdir/usr/share/man" install

  # install license
  install -Dm0644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" 
}
